package com.kang.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.kang.dao.SupplyAgreementItemMapper;
import com.kang.pojo.SupplyAgreementItem;
import com.kang.service.SupplyAgreementItemService;
import com.vonechina.entity.page.AggrementItemPage;

/**
 * 供货协议物品信息服务层实现类
 * 
 * @author zs614
 *
 */
@Service
public class SupplyAgreementItemServiceImpl implements SupplyAgreementItemService {
	/**
	 * 供应商供货协议物品信息持久层
	 */
	@Resource
	private SupplyAgreementItemMapper s_item;

	/**
	 * 查看供货协议下物品信息
	 * 
	 * @param supplyagreementid
	 *            供货协议ID
	 * @return
	 */
	@Override
	public List<SupplyAgreementItem> s_iteminfo(Integer supplyagreementid) {

		return s_item.s_iteminfo(supplyagreementid);
	}

	/**
	 * 删除供货协议物品信息
	 * 
	 * @param id
	 *            供货协议物品信息ID
	 * @return
	 */
	@Override
	public int deleteByPrimaryKey(Integer id) {

		return s_item.deleteByPrimaryKey(id);
	}

	/**
	 * 新增供货协议物品信息
	 * 
	 * @param record
	 *            供货协议物品信息实体类
	 * @return
	 */
	@Override
	public int insert(SupplyAgreementItem record) {

		return s_item.insert(record);
	}

	/**
	 * 
	 * @param record
	 *            供货协议物品信息实体类
	 * @return
	 */
	@Override
	public int insertSelective(SupplyAgreementItem record) {

		return s_item.insertSelective(record);
	}

	/**
	 * 通过ID查询供货协议物品信息
	 * 
	 * @param id
	 *            供货协议物品信息ID
	 * @return
	 */
	@Override
	public SupplyAgreementItem selectByPrimaryKey(Integer id) {

		return s_item.selectByPrimaryKey(id);
	}

	/**
	 * 更新供货协议物品信息
	 * 
	 * @param record
	 *            供货协议物品信息实体类
	 * @return
	 */
	@Override
	public int updateByPrimaryKeySelective(SupplyAgreementItem record) {

		return s_item.updateByPrimaryKeySelective(record);
	}

	/**
	 * 更新供货协议物品信息
	 * 
	 * @param record
	 *            供货协议物品信息实体类
	 * @return
	 */
	@Override
	public int updateByPrimaryKey(SupplyAgreementItem record) {

		return s_item.updateByPrimaryKey(record);
	}

	/**
	 * 查询符合条件供货协议物品信息
	 * 
	 * @param itemPage
	 *            搜索条件实体类
	 * @return
	 */
	@Override
	public List<SupplyAgreementItem> selectNotAddItem(AggrementItemPage itemPage) {
		itemPage.setRows(s_item.countNotAddItem(itemPage));
		return s_item.listNotAddItem(itemPage);
	}

	/**
	 * 删除供货协议物品信息
	 * 
	 * @param supplyagreementid
	 *            供货协议ID
	 * @param itemIds
	 *            供货协议物品信息ID
	 * @return
	 */
	@Override
	public int deleteAgreementItem(int supplyagreementid, Integer[] itemIds) {
		return s_item.deleteAgreementItem(supplyagreementid, itemIds);
	}

	/**
	 * 查询供货协议物品信息
	 * 
	 * @param supplyagreementid
	 *            供货协议物品信息ID
	 * @param itemId
	 *            物品供货协议物品信息
	 * @return
	 */
	@Override
	public SupplyAgreementItem selectAgreementItem(int supplyagreementid, Integer itemId) {
		return s_item.selectAgreementItem(supplyagreementid, itemId);
	}

	/**
	 * 更新供货协议物品信息
	 * 
	 * @param record
	 *            供货协议物品信息实体类
	 * @return
	 */
	@Override
	public int updateAgreementItem(SupplyAgreementItem record) {
		return s_item.updateAgreementItem(record);
	}
}
